﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication
{
    class ConsoleApp
    {
        #region Console input / output
        public static void ConsoleIO()
        {
            //  Console input / output
            int readNumber;

            do  // Use do while loop, to validate the input mumber between 1 - 10.
            {
                Console.WriteLine("Please enter a digit between 1 - 10:");
                readNumber = Int32.Parse(Console.ReadLine());
            }
            while (readNumber < 1 || readNumber > 10);

            Console.WriteLine("The square of {0} is {1}.", readNumber, readNumber * readNumber);
            Console.ReadKey();
        }
        #endregion

    }
}
